#include<iostream>
#include<cstring>
#include<vector>
#include<string>
#include<vector>
#include<sstream>
#include<stack>
using namespace std;

stack<double> s;

double Calc(vector<string> & c)
{
	while (!s.empty()) s.pop();
	int l = c.size();
	for (int i = 0; i<l; i++)
	{
		if (isdigit(c[i][0]))
		{
			stringstream ss(c[i]);
			double tmp;
			ss >> tmp;
			s.push(tmp);
		}
		else
		{
			double res2 = s.top();
			s.pop();
			double res1 = s.top();
			s.pop();
			switch (c[i][0])
			{
			case '+':res1 += res2; break;
			case '-':res1 -= res2; break;
			case '*':res1 *= res2; break;
			case '/'://res1 /= res2; break;
				if (res2 == 0)
					return 100000;
				else
				{
					res1 /= res2; break;
				}
			}
			s.push(res1);
		}
	}
	return s.top();
}